import pkg from "./package";

export default {
  // Global page headers (https://go.nuxtjs.dev/config-head)
  head: {
    title: "xianyun_52", // 标题
    meta: [
      { charset: "utf-8" },
      { name: "viewport", content: "width=device-width, initial-scale=1" },
      { hid: "description", name: "description", content: pkg.description } //添加content
    ],
    link: [
      { rel: "icon", type: "image/x-icon", href: "/favicon.ico" },
      {
        rel: "stylesheet",
        type: "text/css",
        href: "//at.alicdn.com/t/font_1168872_ehvuah8v57g.css"
      } //新增全局字体样式
    ]
  },

  // 自定义进度条颜色
  loading: { color: "#fff" },

  // Global CSS (https://go.nuxtjs.dev/config-css)
  css: [
    "element-ui/lib/theme-chalk/index.css",
    "assets/main.css" // 新增自定义的页面过度样式
  ],

  // Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
  plugins: [
    "@/plugins/element-ui",
    { src: "@/plugins/localStorage", ssr: false }, //不配置在nuxt
    "@/plugins/myaxios",
  ],

  // Auto import components (https://go.nuxtjs.dev/config-components)
  components: true, // 默认会引入components中的组件

  // Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
  buildModules: [],

  // Modules (https://go.nuxtjs.dev/config-modules)
  modules: [
    //Vue.prototype.$axios = axios
    //如果进行了下面的配置，会自动在Vue实例挂载一个$axios
    // https://go.nuxtjs.dev/axios
    "@nuxtjs/axios"
  ],

  /*
   ** Axios module configuration
   */
  axios: {
    // See https://github.com/nuxt-community/axios-module#options
    baseURL: "http://157.122.54.189:9095" // 新增备用地址
    // baseURL: "http://127.0.0.1:1337" // 新增axios默认请求路径
  },

  // Build Configuration (https://go.nuxtjs.dev/config-build)
  build: {
    transpile: [/^element-ui/],
    /*
     ** You can extend webpack config here
     */
    extend(config, ctx) {}
  }
};
